home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / DELPHI32 / SYS_TOOL / MULTI020 / MPTTYCRT.PAS < prev    next >
Pascal/Delphi Source File  |  1993-09-07  |  673b  |  33 lines

  1. unit MPTtyCrt;
  2. { Provides client which dumps output from pipe to the screen }
  3. interface
  4. uses crt, multi, mpipes;
  5.  
  6. procedure AttachOutputToCRT(m : pPipe);
  7. { Start a client which reads characters from the pipe and outputs it
  8.   to the screen using CRT. }
  9.  
  10. implementation
  11.  
  12. procedure OutputToCRT(var m); far;
  13. var
  14.   p : tPipe absolute m;
  15.   ch : char;
  16. begin
  17.   t^.hasexit := true;
  18.   p.NewOutputTask;
  19.   repeat
  20.     ch := p.Get;
  21.     if not t^.Poisoned then write(ch);
  22.     if Switch then break
  23.   until false;
  24.   p.NoMoreOutput
  25. end;
  26.  
  27. procedure AttachOutputToCRT(m : pPipe);
  28. begin
  29.   Fork(OutputToCRT,2048,m^{$IFDEF DEBUG},'OutputToCRT'{$ENDIF})
  30. end;
  31.  
  32. end.
  33.